package com.community.entity;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private int code;
    private String message;
    private Object data;

    public static Result success(Object data){
        return new Result(10000, "success", data);
    }

    public static Result fail(String str) {
        return new Result(404, "fail", str);
    }

    public static Result fail(int code, String str) {
        return new Result(code, "fail", str);
    }
}
